<template>
    <svg :style="{width, height}">
        <use :xlink:href="prefix + name" :fill="color"></use>
    </svg>
</template>
  
<script setup lang="ts">
defineProps({
    //前缀
    prefix: {
        type: String,
        default: "#icon-"
    },
    //图标名称
    name: String,
    //颜色
    color: {
        type: String,
        default: ""
    },
    //宽高，不传入默认为30px
    width: {
        type: String,
        default: "30px"
    },
    height: {
        type: String,
        default: "30px"
    },
})
</script>
  
<style scoped></style>